/**
 * Created by fangshufeng on 2017/9/19.
 */


import  React from  'react';

/**
 * textarea 感觉就是oc的textView
 * */
export  default  class TextAreaTag extends  React.Component {

    constructor () {
        super();
        this.state = {
            value:'',
        }
    }

    changeText = (e) => {
        this.setState({
            value:e.target.value,
        })
    };

    submitAction = (e) => {
        alert('提交的是',this.state.value);
        e.preventDefault();
    };
    render() {
        return (
            <form onSubmit={this.submitAction}>
                <label>
                    Name:
                    <textarea value={this.state.value} onChange={this.changeText}/>
                </label>
                <input type="submit" value="Submit"/>
            </form>
        );
    }
}